<%@ page import="org.springside.core.Constants"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp" %>
<fmt:message key="news_portal_label1" var="news_portal_label1"/>
<fmt:message key="news_portal_label2" var="news_portal_label2"/>
<fmt:message key="news_portal_label3" var="news_portal_label3"/>

<ff:boxportlet header="${news_portal_label1}">
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="padding-left:5px">
	<tr>
		<td valign="top"> 
	<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="tbl_left_ico">
        <c:forEach var="news" items="${newss}"> 
        <c:set var="isNew" value="1"/>
            <c:forEach var="reads" items="${news.newsReads}">
            <c:if test="${reads.readUser.id==sessionScope.loginUser.id}">
            	<c:set var="isNew" value="0"/>
            </c:if>
        </c:forEach>
        <tr> 
          <td> 
            <a href="#"
            	onClick='mainJump("/modules/news/news.do?method=show&cid=${news.newsCatalogy.id}&id=${news.id}","<%=Constants.USER_THEME_FRAME %>")'
            	title="${news.title}"> <c:choose> <c:when test="${fn:length(news.title) > param.y}"> 
            <c:if test="${isNew eq 1}"><b></c:if>
            ${fn:substring(news.title, 0,  param.y)}...<c:if test="${isNew eq 1}"></b></c:if></c:when> <c:otherwise> 
            <c:if test="${isNew eq 1}"><b></c:if>${news.title} <c:if test="${isNew eq 1}"></b></c:if>
            </c:otherwise> </c:choose> </a>
           	<c:if test="${isNew eq 1}">
            	<img src="<c:url value="../../themes/${sessionScope.loginUser.theme}/home/images/new.gif"/>">
            </c:if>
            <c:if test="${news.createdate!=null}">
				<font color="#999999">(<fmt:formatDate value="${news.createdate}" pattern="MM-dd HH:mm"/>)</font>
			</c:if>
            </td>
        </tr>
        </c:forEach> 
        <c:if test="${fn:length(newss)<1}"> 
        <tr> 
          <td>&nbsp; </td>
        </tr>
        </c:if> 
        <c:if test="${fn:length(newss)<2}"> 
        <tr> 
          <td>&nbsp; </td>
        </tr>
        </c:if> 
        <c:if test="${fn:length(newss)<3}"> 
        <tr> 
          <td>&nbsp; </td>
        </tr>
        </c:if> 
        <c:if test="${fn:length(newss)<4}"> 
        <tr> 
          <td>&nbsp; </td>
        </tr>
        </c:if> 
        <c:if test="${fn:length(newss)<5}"> 
        <tr> 
          <td>&nbsp; </td>
        </tr>
        </c:if> 
      </table>

	<table width="100%" height="17">
        <tr>
          <td>&nbsp;</td>
          <td width="30" class="tbl_more_ico_td">
          <a href="#" class="link_portlet" onClick='mainJump("/modules/news/news.do?method=recent&ec_s_createdate=desc","<%=Constants.USER_THEME_FRAME %>")'
         	title="<fmt:message key="common_more" />"><fmt:message key="common_more" /></a></td>
        </tr>
     </table>
		</td>
	</tr>
</table>     
</ff:boxportlet>
